<html>
	<head>
        <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7/dijit/themes/tundra/tundra.css" />
        <script type="text/javascript">
            var dojoConfig = {
                parseOnLoad: true,
                isDebug: true,
                locale: 'ru-ru',
            };
        </script>
        <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7/dojo/dojo.js"></script>

        <script type="text/javascript">
            dojo.require('dojo.fx');

            dojo.ready(function(){
               console.log('document ready!');

                var node = dojo.byId('mainDiv');
                node.innerHTML = 'Документ готов';



                var arr = ["foo", "hoo", "zoo"];
                //position = dojo.indexOf(arrIndxOf, "zoo");

                dojo.forEach(dojo.query('li'), function (element, index) {
                    dojo.connect(element, 'onclick', function () {
                        dojo.anim(this, {color: "#00ffff"}) 
                    });
                    element.innerHTML = index;
                });
                dojo.forEach(arr, function(item, i){
                    var li = dojo.doc.createElement('li');
                    li.innerHTML = i + 1 + '. ' + item;
                    dojo.byId('forEachUl').appendChild(li);
                });

                //Фильтрация
                var arrForFilter = [{surname: "Washington", name: "Paul"},
                                   {surname: "Gordon", name: "Amie"},
                                   {surname: "Meyer", name: "Sofie"},
                                   {surname: "Jaysons", name: "Josh"},
                                   {surname: "Washington", name: "George"},
                                   {surname: "Doormat", name: "Amber"},
                                   {surname: "Smith", name: "Susan"},
                                   {surname: "Hill", name: "Strawberry"},
                                   {surname: "Washington", name: "Dan"},
                                   {surname: "Dojo", name: "Master"}];
                
                
                var filteredArr = dojo.filter(arrForFilter, function(item) {
                    return item.surname == 'Washington';
                });

                dojo.forEach(filteredArr, function(item, i) {
                    
                    var li = dojo.doc.createElement('li');
                    li.innerHTML = i + 1 + '. ' + item.surname + ', ' + item.name;
                    dojo.byId('forEachUl').appendChild(li);
                });


                var arrSalary = [200, 300, 1500, 5, 4500];

                
                var raisedSalaries = dojo.map(arrSalary, function(item) {
                    return item + (item / 100) * 10;
                });

                dojo.forEach(raisedSalaries, function(item, i){
                    var li = dojo.doc.createElement('li');
                    li.innerHTML = i + 1 + '. Новая величина: ' + item;
                    dojo.byId('forEachUl').appendChild(li);
                });

                dojo.forEach(arrSalary, function(item, i){
                    var li = dojo.doc.createElement('li');
                    li.innerHTML = i + 1 + '. Старая величина: ' + item;
                    dojo.byId('forEachUl').appendChild(li);
                });




                var arrIndxSome = [200000, 500000, 350000, 1000000, 75, 3];

                if (dojo.some(arrIndxSome, function (item) { return item >= 1000000})) {
                    result = 'В массиве есть значение больше 1000000';
                } else {
                    result = 'В массиве нет значение больше 1000000';
                }

                alert(result);


                var arrIndxEvery = [{'month': 'january', 'income': 2000}, {'month': 'february', 'income': 3200}, {'month': 'march', 'income': 2100}];


                if(dojo.every(arrIndxEvery , function(item){ return item.income >= 300})){
                    result = 'все элементы удовлетворяют условию';
                } else {
                    result = 'не все элементы не удовлетворяют условию';
                }

                dojo.place(
                    "<p>The answer is: " + result + "</p>",
                    "mainDiv",
                    "after"
                );
            });
        </script>


    </head>
    <body class="tundra">
        <div id="mainDiv">

        </div>
        <ul id="forEachUl">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </body>
</html>